using System;
using System.Collections.Generic;
using System.Text;
using BusinessObjects.BO_Actions;
using Entity.StoreProcedure;
using BusinessObjects;
using System.Data;
namespace BusinessObjects.BO_GetObjects
{
    public static class BO_portal_guest_log
    {
        public static DataTable SelectAll()
        {
            try
            {
                usp_portal_guest_log_select_all entity = new usp_portal_guest_log_select_all();

                return BO_Actions<usp_portal_guest_log_select_all>.ExecuteAndReturnDataTable(entity);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
        public static DataTable SelectTop(int rows)
        {
            try
            {
                usp_portal_guest_log_select_top entity = new usp_portal_guest_log_select_top();
                entity.NUMBERRECORD = rows;

                return BO_Actions<usp_portal_guest_log_select_top>.ExecuteAndReturnDataTable(entity);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
        public static string Insert(string url, DateTime access_date, string ip_address, string region)
        {
            try
            {
                usp_portal_guest_log_insert entity = new usp_portal_guest_log_insert();
                entity.URL = url;
                entity.ACCESS_DATE = access_date;
                entity.IP_ADDRESS = ip_address;
                entity.REGION = region;
                return BO_Actions<usp_portal_guest_log_insert>.ExecuteAndReturnStringValue(entity);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
        public static DataTable SelectAdmin(string keyword, int current, int maxrecord)
        {
            try
            {
                usp_portal_guest_log_select_admin entity = new usp_portal_guest_log_select_admin();
                entity.KEYWORDS = keyword;
                entity.MAXRECORDS = maxrecord;
                entity.STARTINDEX = current;
                return BO_Actions<usp_portal_guest_log_select_admin>.ExecuteAndReturnDataTable(entity);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
    }
}

